#ifndef USER_MANAGER_HPP
#define USER_MANAGER_HPP

#include <string>
#include <unordered_map>
#include <set>
#include <mutex>
#include <vector>

class UserManager {
public:
    void add_user(int fd);
    void remove_user(int fd);
    void rename_user(int fd, const std::string& name);
    std::string get_name(int fd);
    int get_fd_by_name(const std::string& name);
    std::vector<int> get_all_fds();

private:
    std::unordered_map<int, std::string> fd_to_name;
    std::unordered_map<std::string, int> name_to_fd;
    std::mutex mutex;
};

extern UserManager user_manager;

#endif // USER_MANAGER_HPP

